/*
 * Copyright 2007-2009 Perttu "celeron55" Ahola <celeron55@gmail.com>
 *
 * This file is part of jukumagic.
 *
 * jukumagic is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * jukumagic is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with jukumagic.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef NETCOMPONENT_H_
#define NETCOMPONENT_H_

#include <wx/wx.h>
#include "common.h"
#include "jukuobject.h"
#include "board.h"

class NetComponent : public JukuObject
{
public:
	//TODO: set all of these private or get rid of Get/SetRefdes/Value
	wxString m_refdes;
	wxString m_value;
	wxString m_footprint;
	wxString m_device;

	NetComponent();
	~NetComponent();
    JukuObjectType GetType()const{ return TYPE_NETCOMPONENT; }
	const wxChar * GetShortString(void){return NULL;}
	const wxChar * GetTypeString(void){return _("NetComponent");}
	void WriteXML(TiXmlNode* root);
	static JukuObject* ReadFromXMLElement(TiXmlElement* element);
	
	wxString GetRefdes(){ return m_refdes; }
	void SetRefdes(wxString refdes){ m_refdes = refdes; }

	wxString GetValue(){ return m_value; }
	void SetValue(wxString value){ m_value = value; }

	/*
		Inserts a component with the right refdes, value and footprint
	*/
	bool ThrowToBoard(Board *board);
};

#endif
